package _04Set接口;

public class Student2 implements Comparable<Student2> {
	int num;
	String name;
	int age;

	public Student2(int num, String name, int age) {

		this.num = num;
		this.name = name;
		this.age = age;
	}

	public Student2() {

	}

	@Override
	public String toString() {
		return num + " " + name + " " + age;
	}

	@Override
	public int compareTo(Student2 o) {
		if (this.age < o.age) {
			return -1;

		} else if (this.age == o.age) {
			return 0;

		} else {
			return 1;
		}
	}

}
